package com.springboot.wisdom.serviceApi.user.model.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * ClassName: LoginUserVO
 *
 * @Author: WangYiHai
 * @Date: 2020/5/19 11:58
 * @Description: TODO
 */
@Data
@ToString
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(description = "登录信息类")
public class RegisterUserVO {

    /**
     * 用户名称
     */
    @NotBlank(message = "请输入用户名称")
    @Size(max = 20, message = "用户名称长度不能大于20")
    @ApiModelProperty(value = "用户名", required = true)
    private String username;

    /**
     * 用户账号
     */
    @NotBlank(message = "请输入用户账号")
    @Size(max = 50, message = "用户账号长度不能大于50")
    @ApiModelProperty(value = "用户账号", required = true)
    private String userAccount;

    /**
     * 密码
     */
    @NotBlank(message = "请输入密码")
    @Size(max = 20, message = "密码长度不能大于20")
    @ApiModelProperty(value = "密码", required = true)
    private String password;

    /**
     * 邮箱
     */
    @NotBlank(message = "请输入邮箱")
    @Email(message = "邮箱格式不对")
    @ApiModelProperty(value = "邮箱", required = true)
    private String email;

    @NotBlank(message = "请输入邮箱验证码")
    @ApiModelProperty(value = "邮箱验证码", required = true)
    private String emailCode;

    /**
     * 电话
     */
    @ApiModelProperty(value = "电话")
    @Length(min = 11, max = 11, message = "手机号只能为11位")
    @Pattern(regexp = "^[1][3,4,5,6,7,8,9][0-9]{9}$", message = "手机号格式有误")
    private String phone;

}